// 子类继承父类所有成员变量
#include <iostream>
using namespace std;
class Father {
public:
    int m_a;
    Father();
    ~Father();
protected:
    int m_b;
private:
    int m_c;
};
Father::Father() {
    cout << "father construct" << endl;
}
Father::~Father() {
    cout << "father destruct" << endl;
}
class Son: public Father {
public:
    int m_c;
    Son();
    ~Son();
};
Son::Son() {
    cout << "son construct" << endl;
}
Son::~Son() {
    cout << "son destruct" << endl;
}
void test1() {
    // Father f1;
    // cout << "sizeof f1 = " << sizeof(f1) << endl;
    Son s1; // 子类可以继承父类的所有属性，只是不能访问private
    cout << "sizeof s1 = " << sizeof(s1) << endl;
    // 父类构造 -> 子类构造 -> 子类析构 -> 父类析构
}
int main(void) {
    test1();

    return 0;
}